CreateMovieFile
TheCreateMovieFile
function creates an open movie file, opens the movie file, creates an empty movie which references the file, and opens the movie file with write permission.
pascal OSErr CreateMovieFile (const FSSpec *fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, short *resRefNum, Movie *newMovie);
fileSpec
- Contains a pointer to the file system specification for the movie file to be created.
creator
- Specifies the creator value for the new file.
scriptTag
- Specifies the script in which the movie file should be created. Use the Script Manager constant
smSystemScript
to use the system script; use thesmCurrentScript
constant to use the current script. See Inside Macintosh: Text for more information about scripts and script tags.createMovieFileFlags
- Controls movie-file creation flags. The following flags are available:
createMovieFileDeleteCurFile
- Indicates whether to delete an existing file. If you set this flag to 1, the Movie Toolbox deletes the file (if it exists) before creating the new movie file. If you set this flag to 0 and the file specified by the
fileSpec
parameter already exists, the Movie Toolbox uses the existing file. In this case, the toolbox ensures that the file has both a data and a resource fork.createMovieFileDontCreateMovie
- Controls whether the
CreateMovieFile
function creates a new movie in the movie file. If you set this flag to 1, the Movie Toolbox does not create a movie in the new movie file. In this case, the function ignores thenewMovie
parameter. If you set this flag to 0, the Movie Toolbox creates a movie and returns the movie identifier in the field referred to by thenewMovie
parameter.createMovieFileDontOpenFile
Controls whether theCreateMovieFile
function opens the new movie file. If you set this flag to 1, the Movie Toolbox does not open the new movie file. In this case, the function ignores theresRefNum
parameter. If you set this flag to 0, the Movie Toolbox opens the new movie file and returns its reference number into the field referred to by theresRefNum
parameter.newMovieActive
- Controls whether the new movie is active. Set this flag to 1 to make the new movie active. A movie that does not have any tracks can still be active. When the Movie Toolbox tries to play the movie, no images are displayed, because there is no movie data. You can make a movie active or inactive by calling the
SetMovieActive
function, which is described on page 2-131.newMovieDontAutoAlternate
- Controls whether the Movie Toolbox automatically selects enabled tracks from alternate track groups. If you set this flag to 1, the Movie Toolbox does not automatically select tracks for the movie--you must enable tracks yourself.
resRefNum
- Contains a pointer to a field that is to receive the file reference number for the opened movie file. Your application must use this value when calling other Movie Toolbox functions that work with movie files. If you set this parameter to
nil
, the Movie Toolbox creates the movie file but does not open the file.newMovie
- Contains a pointer to a field that is to receive the identifier of the new movie. The
CreateMovieFile
function returns the identifier of the new movie. If the function could not create a new movie, it sets this returned value tonil
. If you set this parameter tonil
, the Movie Toolbox does not create a movie.ERROR CODES
File Manager errors
movieToolboxUninitialized -2020 You haven't initialized the Movie Toolbox
Memory Manager errorsSEE ALSO
You can delete a movie file by calling theDeleteMovieFile
function, which is described on page 2-87.Your application can use the functions described in "Creating Tracks and Media Structures," which begins on page 2-136, to place movie data into the new movie file.